1. Field
Embodiments of the invention relate to the field of managing the storage of files on a media in a computer system; and more specifically, to the managing the storage of files on a non-volatile solid-state memory storage device.
2. Background
Processor based devices such as general purpose computers, personal digital assistants, wireless communications devices, personal media players, and the like generally require some form of non-volatile storage to store significant amounts of data for extended periods of time without requiring power. Historically, rotating magnetic storage, such as a disk drive, has been a common choice to provide non-volatile storage because of its relatively low cost and compact size.
More recently solid state memories, such as NAND flash memory, have become a viable alternative to disc drives to provide non-volatile storage for processor based devices. Solid state memories are generally packaged as a solid state drive (SSD) for use as an alternative to a disk drive. An SSD typically uses the same interface as a disk drive and is arranged to operate in the same manner as a disk drive so that an SSD may be used interchangeably with a disk drive. This allows an SSD to be used in a processor based device with little, if any, change to the software that runs on the device.
While an SSD can be made to look outwardly like a disk drive, the solid state memories that provide the persistent storage of the SSD have some characteristics that differ markedly from the characteristics of magnetically recorded data. Flash memory, and particularly NAND flash memory, is a popular choice for solid state memory in an SSD. Among the differences between NAND flash memory and magnetic media is that flash memory cannot be erased in small units, such as bytes, but only in large blocks. SSDs typically provide “garbage collection” that finds blocks where a significant portion of the block has been deleted, moves any remaining active data to a new block, and erases the block, freeing it for future writes. This generally means that data written to an SSD will be written to memory in the drive more than once over its lifetime. This and other operations that maintain the SSD result in more writes being performed by the SSD than were requested by the host device, a phenomenon known as “write amplification.”
Another limitation of flash memory is that it provides only a finite number of program-erase cycles before the integrity of the storage deteriorates. While the number of program-erase cycles provided by flash memories is increasing, currently many devices provide about 100,000 cycles. SSDs typically provide “wear leveling” which attempts to write data in a such a way that the number of program-erase cycles for the blocks is reasonably uniform for the entire drive.
Considerations such as the above and performance considerations force a trade-off in the block size of the memory used in an SSD. Smaller block sizes make erasure, garbage collection, and wear leveling more efficient and reduce write amplification. On the other hand, large block sizes, which may be implemented by data striping a block across multiple memory devices, increase read/write speeds of the SSD.
An SSD may attempt to separate static and dynamic data to reduce write amplification. When static data, which rarely changes, is written to the same block as dynamic data, which frequently changes, the static data will have to be rewritten because the dynamic data will cause a portion of the block to be deleted, and eventually garbage collected. However, it is difficult for an SSD to determine what data is static and what is dynamic. Such a process requires maintaining historical data to identify static data. Static data is likely to be rewritten several times before it is identified as static. Further, even data that is identified as static will probably be deleted at some point in time. Deleting static data therefore can still cause a portion of the block to be deleted, and eventually garbage collected although more slowly than if dynamic data is intermingled with static data.
It would be desirable to provide a mechanism that allows an SSD to more effectively separate static and dynamic data.